﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Default.Master" Inherits="System.Web.Mvc.ViewPage<WebStickyNotes.Models.TaskProrityIndexModel>" %>
<%@ Import Namespace="WebStickyNotes.Resources" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%= Labels.PageTitlePriorities %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <article>
        <header>
            <h2><%= Labels.PageTitlePriorities %></h2>
        </header>
        <section>
            <div id="taskpriorities" class="hastable">
                <table>
                    <thead>
                        <tr>
                            <th><%= Labels.Title %></th>
                            <th><%= Labels.Importance %></th>
                            <% if (Model.CurrentUser.TaskRoleId == 1) { %>
                            <th><%= Labels.Edit %></th>
                            <th><%= Labels.Delete %></th>
                            <% } %>
                        </tr>
                    </thead>
                    <tbody id="draganddropsort">
                    <% foreach (var taskPriority in Model.TaskPriorities) { %>
                        <tr>
                            <td><%= taskPriority.Title %></td>
                            <td><%= taskPriority.Importance %></td>
                            <% if (Model.CurrentUser.TaskRoleId == 1) { %>
                            <td><%= Html.ActionLink("Edit", "Edit", new { id = taskPriority.Id }, new { @class = "button" }) %></td>
                            <td><%= Html.ActionLink("Delete", "Delete", new { id = taskPriority.Id }, new { @class = "button" }) %></td>
                            <% } %>
                        </tr>
                    <% } %>
                    </tbody>
                </table>
            </div>
        </section>
        <footer>
            <%= WebStickyNotes.Helpers.PagingHelper.ShowPageLinks(Model.PagingLink, "pages", Model.CurrentPage, Model.PageSize, Model.TotalRecords) %>
        </footer>
    </article>
</asp:Content>

<asp:content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function() {
            $("#draganddropsort").draganddropsort();
        });
    </script>
</asp:content>